package classes.view
{
	import classes.OX_Application;
	import classes.controller.DAOSendFlash;
	import classes.controller.DAOSendJS;
	import classes.controller.ESendJS;
	import classes.model.VOIsLocal;
	import classes.view.component.LoadingBar;
	
	import flash.events.Event;
	import flash.external.ExternalInterface;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	public class Mediator_Load extends Mediator implements IMediator
	{
		public static const NAME:String = "Mediator_Loadingbar";
		public function Mediator_Load(mediatorName:String=null, viewComponent:Object=null)
		{
			super(mediatorName, viewComponent);
		}
		
		override public function listNotificationInterests():Array
		{
			return [OX_Application.LOADING_IN
				   ,OX_Application.LOADING_OUT
				   ];
		}
		override public function handleNotification(notification:INotification):void
		{
			switch(notification.getName()){
				
				case OX_Application.LOADING_IN :
					loadingbar.switchLoadingbar = true;
				break;
				case OX_Application.LOADING_OUT :
					loadingbar.switchLoadingbar = false;
				break;
			}
		}
		
		protected function get loadingbar():LoadingBar
		{
			return this.viewComponent as LoadingBar;
		}
	}
}
